<html>
<head><meta charset="utf-8"><title>unconditional recursion lint · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/unconditional.20recursion.20lint.html">unconditional recursion lint</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="195541079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/unconditional%20recursion%20lint/near/195541079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/unconditional.20recursion.20lint.html#195541079">(Apr 28 2020 at 09:57)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/57965" title="https://github.com/rust-lang/rust/issues/57965">https://github.com/rust-lang/rust/issues/57965</a></p>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> Do you currently have enough time to review a PR implementing this.<br>
WIll also probably need some help along the way</p>



<a name="195541206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/unconditional%20recursion%20lint/near/195541206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/unconditional.20recursion.20lint.html#195541206">(Apr 28 2020 at 09:58)</a>:</h4>
<p>Oh yeah I'd love to see this happen! Not sure I can help much though.</p>



<a name="195768238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/unconditional%20recursion%20lint/near/195768238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/unconditional.20recursion.20lint.html#195768238">(Apr 29 2020 at 20:51)</a>:</h4>
<p>Ok,looked into this and have a general idea on how this may work.</p>
<p>My idea is to use <code>par_body_owners</code> at the end of <code>librustc_interface::passes::analysis</code> to walk through all impls and do something similar to the current <code>unconditional_recursion</code> check (except on <code>optimized_mir</code> instead of <code>mir_built</code>, as I don't know how to deal with <code>Steal</code> otherwise). We now actually follow function calls under the following conditions:</p>
<ul>
<li>the function is implemented in the local crate</li>
<li>the corresponding impl can be uniquely identified using the current generic args <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=9e73c2a2544ec267ebf46eff071c84d8" title="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=9e73c2a2544ec267ebf46eff071c84d8">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=9e73c2a2544ec267ebf46eff071c84d8</a></li>
</ul>



<a name="195768335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/unconditional%20recursion%20lint/near/195768335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/unconditional.20recursion.20lint.html#195768335">(Apr 29 2020 at 20:52)</a>:</h4>
<p>This would require <code>optimized_mir</code> for functions which wouldn't be built otherwise afaict... ?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>